import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { PayGroupLogVO, PayGroupLogForm, PayGroupLogQuery } from '@/api/system/PayGroupLog/types';

/**
 * 查询轮询日志列表
 * @param query
 * @returns {*}
 */

export const listPayGroupLog = (query?: PayGroupLogQuery): AxiosPromise<PayGroupLogVO[]> => {
  return request({
    url: '/system/PayGroupLog/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询轮询日志详细
 * @param logId
 */
export const getPayGroupLog = (logId: string | number): AxiosPromise<PayGroupLogVO> => {
  return request({
    url: '/system/PayGroupLog/' + logId,
    method: 'get'
  });
};

/**
 * 新增轮询日志
 * @param data
 */
export const addPayGroupLog = (data: PayGroupLogForm) => {
  return request({
    url: '/system/PayGroupLog',
    method: 'post',
    data: data
  });
};

/**
 * 修改轮询日志
 * @param data
 */
export const updatePayGroupLog = (data: PayGroupLogForm) => {
  return request({
    url: '/system/PayGroupLog',
    method: 'put',
    data: data
  });
};

/**
 * 删除轮询日志
 * @param logId
 */
export const delPayGroupLog = (logId: string | number | Array<string | number>) => {
  return request({
    url: '/system/PayGroupLog/' + logId,
    method: 'delete'
  });
};
